﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TO4ValueType
{
    //定义委托
    public delegate int Buy(string name);
    class DelegateBuy
    {
        public int BuyApple(string name)
        {
            Console.WriteLine("{0}买苹果",name);
            return 10;
        }
        public int BuyBanana(string name)
        {
            Console.WriteLine("{0}买香蕉", name);
            return 10;
        }
    }
}
